package com.dh.container;

import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

import com.dh.util.UuidTool;

public class CurrentHashMapTest {
	public static void main(String args[]) {
		
		List<String> arr=new ArrayList<String>();
		
		ConcurrentHashMap cur=new ConcurrentHashMap();
		
		Hashtable<String, String> hat=new Hashtable<>();
		/*Long star1=System.currentTimeMillis();
		 for(int i=0;i<1000;i++) {
			new Thread(new Runnable() {
				@Override
				public void run() {
					for(int j=0;j<1000;j++) {
						cur.put(UuidTool.getUUID32(), j*1);
					}
					
				}
			}).start();
		}
		Long end1=System.currentTimeMillis();
		System.out.println("执行时间1："+(end1-star1));*/
		
		Long star=System.currentTimeMillis();
		for(int i=0;i<1000;i++) {
			new Thread(new Runnable() {
				@Override
				public void run() {
					for(int j=0;j<1000;j++) {
						hat.put(UuidTool.getUUID32(), j*1+"");
					}
					
				}
			}).start();
		}
		Long end=System.currentTimeMillis();
		System.out.println("执行时间2："+(end-star));
		
	}

}
